// HttpClient.h: interface for the CHttpClient class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HTTPCLIENT_H__4950B66D_7095_4A03_903A_D8F252ED55F0__INCLUDED_)
#define AFX_HTTPCLIENT_H__4950B66D_7095_4A03_903A_D8F252ED55F0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//#include "lclog.h"
#include <memory>
#include <windows.h>
#include <wininet.h>
#define HTTP_DEF_XMLACCEPT "accept-language: zh-cn\r\n"\
	"x-prototype-version: 1.4.0\r\n"\
	"referer: %s\r\n"\
	"x-requested-with: XMLHttpRequest\r\n"\
"content-type: application/x-www-form-urlencoded"
#define HTTP_DEF_HTTPACCEPT "*/*"

class CHttpClient  
{
public:
	HINTERNET   m_hSession;
	HINTERNET   m_hConnection;
	char m_lasturl[1024];
	CHttpClient();
	virtual ~CHttpClient();
	int Get(char * pServerName,char * pUrlPath,char * pLocatePath);
	int Post(char * pServerName,char * pUrlPath,char * pLocatePath,char *pParm);
	int Posts(char * pServerName,char * pUrlPath,char * pLocatePath,char *pParm);
	int OpenUrl(char * purl,char * pLocatePath);
	int GetMem(char * pServerName,char * pUrlPath,char * pLocatePath);
	int PostMem(char * pServerName,char * pUrlPath,char *pParm,char * buffer,int &bufferlen);
	int PostsMem(char * pServerName,char * pUrlPath,char * pLocatePath,char *pParm);
	int OpenUrlMem(char * purl,char * buffer,int &bufferlen);
	int SetReferer(char * pReferer);
};

#endif // !defined(AFX_HTTPCLIENT_H__4950B66D_7095_4A03_903A_D8F252ED55F0__INCLUDED_)





















